<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
</head>
<body>
<p>支持微软office和wps在线编辑服务</p>
<a href="#">先访问http://localhost:8080/edit/allow开启访问权限</a><br>
<button id="btn1">只读打开文件</button>
<button id="btn2">编辑文件</button>
<script>
    $(document).ready(function(){
        $("#btn1").click(function(){
            $.ajax({url:"http://localhost:8080/edit/allow?readOnly=false&username=saver",success:function(result){
                    window.location.href="EditOffice://"+result
                }});
        });
        $("#btn2").click(function(){
            $.ajax({url:"http://localhost:8080/edit/allow?readOnly=true&username=saver",success:function(result){
                    window.location.href="EditOffice://"+result
                }});
        });
    });
</script>
</body>
</html>